package cn.czh.inventory.common.exception;

import cn.czh.inventory.common.web.ServiceCodeEnum;


/**
 * 自定义业务异常
 */
public class ServiceException extends RuntimeException {

    private Integer serviceCode;
    /**
     * 一个异常应该包含什么信息
     * message 消息
     * code  状态码
     */

    public ServiceException(Integer serviceCode,String message) {
        super(message);
        this.serviceCode = serviceCode;
    }

    public ServiceException(ServiceCodeEnum serviceCode) {
        super(serviceCode.getMsg());
        this.serviceCode = serviceCode.getCode();
    }

}
